<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>PopUpButton.as</title>
<link rel="stylesheet" type="text/css" href="../../../SourceStyles.css"/>
</head>

<body><pre><span class="ActionScriptComment">////////////////////////////////////////////////////////////////////////////////
</span><span class="ActionScriptComment">//
</span><span class="ActionScriptComment">//  ADOBE SYSTEMS INCORPORATED
</span><span class="ActionScriptComment">//  Copyright 2005-2007 Adobe Systems Incorporated
</span><span class="ActionScriptComment">//  All Rights Reserved.
</span><span class="ActionScriptComment">//
</span><span class="ActionScriptComment">//  NOTICE: Adobe permits you to use, modify, and distribute this file
</span><span class="ActionScriptComment">//  in accordance with the terms of the license agreement accompanying it.
</span><span class="ActionScriptComment">//
</span><span class="ActionScriptComment">////////////////////////////////////////////////////////////////////////////////
</span>
<span class="ActionScriptpackage">package</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>
<span class="ActionScriptBracket/Brace">{</span>

<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">display</span>.<span class="ActionScriptDefault_Text">DisplayObjectContainer</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">Event</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">FocusEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">KeyboardEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">MouseEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">geom</span>.<span class="ActionScriptDefault_Text">Point</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">geom</span>.<span class="ActionScriptDefault_Text">Rectangle</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">ui</span>.<span class="ActionScriptDefault_Text">Keyboard</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">utils</span>.<span class="ActionScriptDefault_Text">getTimer</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">listClasses</span>.<span class="ActionScriptDefault_Text">IListItemRenderer</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">EdgeMetrics</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">IFlexDisplayObject</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">IRectangularBorder</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">IUIComponent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">FlexVersion</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">UIComponent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">UIComponentGlobals</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">mx_internal</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">effects</span>.<span class="ActionScriptDefault_Text">Tween</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">DropdownEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">ListEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">MenuEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">FlexMouseEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">managers</span>.<span class="ActionScriptDefault_Text">IFocusManagerComponent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">managers</span>.<span class="ActionScriptDefault_Text">PopUpManager</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">styles</span>.<span class="ActionScriptDefault_Text">ISimpleStyleClient</span>;

<span class="ActionScriptReserved">use</span> <span class="ActionScriptReserved">namespace</span> <span class="ActionScriptDefault_Text">mx_internal</span>;

<span class="ActionScriptComment">//--------------------------------------
</span><span class="ActionScriptComment">//  Events
</span><span class="ActionScriptComment">//-------------------------------------- 
</span>
<span class="ActionScriptASDoc">/**
 *  Dispatched when the specified UIComponent closes. 
 *
 *  @eventType mx.events.DropdownEvent.CLOSE
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Event</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;close&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;mx.events.DropdownEvent&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Dispatched when the specified UIComponent opens.
 *
 *  @eventType mx.events.DropdownEvent.OPEN
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Event</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;open&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;mx.events.DropdownEvent&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptComment">//--------------------------------------
</span><span class="ActionScriptComment">//  Styles
</span><span class="ActionScriptComment">//--------------------------------------
</span>
<span class="ActionScriptReserved">include</span> <span class="ActionScriptString">&quot;../styles/metadata/IconColorStyles.as&quot;</span>

<span class="ActionScriptASDoc">/**
 *  Number of pixels between the divider line and the right 
 *  edge of the component.
 *  The default value is 16.
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;arrowButtonWidth&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Number&quot;</span>, <span class="ActionScriptDefault_Text">format</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Length&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Length of a close transition, in milliseconds.
 *  The default value is 250.
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;closeDuration&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Number&quot;</span>, <span class="ActionScriptDefault_Text">format</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Time&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Easing function to control component closing tween.
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;closeEasingFunction&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Function&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  The default icon class for the main button.
 *
 *  @default null
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;icon&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Class&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span>, <span class="ActionScriptDefault_Text">states</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;up, over, down, disabled&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Length of an open transition, in milliseconds.
 *  The default value is 250.
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;openDuration&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Number&quot;</span>, <span class="ActionScriptDefault_Text">format</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Time&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Easing function to control component opening tween.
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;openEasingFunction&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Function&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  The name of a CSS style declaration used by the control.  
 *  This style allows you to control the appearance of the 
 *  UIComponent object popped up by this control. 
 *
 *  @default undefined
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;popUpStyleName&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;String&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Skin class for the popUpDown state (when arrowButton is in down 
 *  state) of the background and border.
 *  @default mx.skins.halo.PopUpButtonSkin
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;popUpDownSkin&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Class&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Number of vertical pixels between the PopUpButton and the
 *  specified popup UIComponent.
 *  The default value is 0.
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;popUpGap&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Number&quot;</span>, <span class="ActionScriptDefault_Text">format</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Length&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  The icon used for the right button of PopUpButton.
 *  Supported classes are mx.skins.halo.PopUpIcon
 *  and mx.skins.halo.PopUpMenuIcon.
 *  @default mx.skins.halo.PopUpIcon
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;popUpIcon&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Class&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Skin class for the popUpOver state (over arrowButton) of 
 *  the background and border.
 *  @default mx.skins.halo.PopUpButtonSkin
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;popUpOverSkin&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Class&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  Default stateful skin class for the control.
 *  @default mx.skins.halo.PopUpButtonSkin
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;skin&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Class&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span>, <span class="ActionScriptDefault_Text">states</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;up, over, down, disabled, popUpOver, popUpDown&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptComment">//--------------------------------------
</span><span class="ActionScriptComment">//  Excluded APIs
</span><span class="ActionScriptComment">//--------------------------------------
</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;toggle&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;property&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedDisabledIcon&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedDisabledSkin&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedDownIcon&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedDownSkin&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedOverIcon&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedOverSkin&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedUpIcon&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Exclude</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;selectedUpSkin&quot;</span>, <span class="ActionScriptDefault_Text">kind</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;style&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptComment">//--------------------------------------
</span><span class="ActionScriptComment">//  Other metadata
</span><span class="ActionScriptComment">//--------------------------------------
</span>
<span class="ActionScriptComment">//[IconFile(&quot;PopUpButton.png&quot;)]
</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">RequiresDataBinding</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">true</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/** 
 *  The PopUpButton control adds a flexible pop-up control
 *  interface  to a Button control.
 *  It contains a main button and a secondary button,
 *  called the pop-up button, which pops up any UIComponent
 *  object when a user clicks the pop-up button. 
 *
 *  &lt;p&gt;A PopUpButton control can have a text label, an icon,
 *  or both on its face.
 *  When a user clicks the main part of the PopUpButton 
 *  control, it dispatches a &lt;code&gt;click&lt;/code&gt; event.&lt;/p&gt;
 *
 *  &lt;p&gt;One common use for the PopUpButton control is to have
 *  the pop-up button open a List control or a Menu control
 *  that changes  the function and label of the main button.&lt;/p&gt;
 *
 *  &lt;p&gt;The PopUpButton control has the following default characteristics:&lt;/p&gt;
 *     &lt;table class=&quot;innertable&quot;&gt;
 *        &lt;tr&gt;
 *           &lt;th&gt;Characteristic&lt;/th&gt;
 *           &lt;th&gt;Description&lt;/th&gt;
 *        &lt;/tr&gt;
 *        &lt;tr&gt;
 *           &lt;td&gt;Default size&lt;/td&gt;
 *           &lt;td&gt;Sufficient width to accommodate the label and icon on the main button and the icon on the pop-up button&lt;/td&gt;
 *        &lt;/tr&gt;
 *        &lt;tr&gt;
 *           &lt;td&gt;Minimum size&lt;/td&gt;
 *           &lt;td&gt;0 pixels&lt;/td&gt;
 *        &lt;/tr&gt;
 *        &lt;tr&gt;
 *           &lt;td&gt;Maximum size&lt;/td&gt;
 *           &lt;td&gt;Undefined&lt;/td&gt;
 *        &lt;/tr&gt;
 *     &lt;/table&gt;
 *
 *  @mxml
 *  
 *  &lt;p&gt;The &lt;code&gt;&amp;lt;mx:PopUpButton&amp;gt;&lt;/code&gt; tag inherits all of the tag
 *  attributes of its superclass and adds the following tag attributes:&lt;/p&gt;
 *  
 *  &lt;pre&gt;
 *  &amp;lt;mx:PopUpButton
 *    &lt;strong&gt;Properties&lt;/strong&gt; 
 *    openAlways=&quot;false|true
 *    popUp=&quot;No default&quot;
 *  
 *    &lt;strong&gt;Styles&lt;/strong&gt;
 *    arrowButtonWidth=&quot;16&quot;
 *    closeDuration=&quot;250&quot;
 *    closeEasingFunction=&quot;No default&quot;
 *    disabledIconColor=&quot;0x999999&quot;
 *    iconColor=&quot;0x111111&quot;
 *    openDuration=&quot;250&quot;
 *    openEasingFunction=&quot;No default&quot;
 *    popUpDownSkin=&quot;popUpDownSkin&quot;
 *    popUpGap=&quot;0&quot;
 *    popUpIcon=&quot;PopUpIcon&quot;
 *    popUpOverSkin=&quot;popUpOverSkin&quot;
 *  
 *    &lt;strong&gt;Events&lt;/strong&gt;
 *    close=&quot;No default&quot;
 *    open=&quot;No default&quot;
 *  /&amp;gt;
 *  &lt;/pre&gt;
 *
 *  @includeExample examples/PopUpButtonExample.mxml
 * 
 */</span>
<span class="ActionScriptReserved">public</span> <span class="ActionScriptclass">class</span> <span class="ActionScriptDefault_Text">PopUpButton</span> <span class="ActionScriptReserved">extends</span> <span class="ActionScriptDefault_Text">Button</span> 
<span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptReserved">include</span> <span class="ActionScriptString">&quot;../core/Version.as&quot;</span>;
    
    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Constructor
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  Constructor.
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">PopUpButton</span><span class="ActionScriptBracket/Brace">()</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span><span class="ActionScriptBracket/Brace">()</span>;
                        
        <span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MouseEvent</span>.<span class="ActionScriptDefault_Text">MOUSE_MOVE</span>, <span class="ActionScriptDefault_Text">mouseMoveHandler</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span>.<span class="ActionScriptDefault_Text">REMOVED_FROM_STAGE</span>, <span class="ActionScriptDefault_Text">removedFromStageHandler</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Variables
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">inTween</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;

    <span class="ActionScriptASDoc">/**
     *  @private
     *  Is the popUp list currently shown?
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">showingPopUp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;

    <span class="ActionScriptASDoc">/**
     *  @private
     *  The tween used for showing/hiding the popUp.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">tween</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Tween</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">null</span>;
    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Greater of the arrowButtonWidth style and the icon&apos;s width.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">arrowButtonsWidth</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> 0;

    <span class="ActionScriptASDoc">/**
     *  @private
     *  Greater of the arrowButtonsHeight style and the icon&apos;s height.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">arrowButtonsHeight</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> 0;

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">popUpIconChanged</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">popUpChanged</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
    
    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden properties
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    
    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  showInAutomationHierarchy
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">showInAutomationHierarchy</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">//do not allow value changes
</span>    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  toggle
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Inspectable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">environment</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;none&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     *  A PopUpButton is not toggleable by definition, so _toggle is set
     *  to false in the constructor and can&apos;t be changed via this setter.
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">toggle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptBracket/Brace">}</span>
     
    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Properties
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>

    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  closeOnActivity
</span>    <span class="ActionScriptComment">//----------------------------------
</span>    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Storage for the closeOnActivity property.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_closeOnActivity</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Specifies popUp would close on click/enter activity.
     *  In popUps like Menu/List/TileList etc, one need not change
     *  this as they should close on activity. However for multiple 
     *  selection, and other popUp, this can be set to false, to 
     *  prevent the popUp from closing on activity.
     *  
     *  @default true 
     */</span>     
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">closeOnActivity</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// We are not exposing this property for now, until the need arises.
</span>        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_closeOnActivity</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>  
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">closeOnActivity</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_closeOnActivity</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    

    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  openAlways
</span>    <span class="ActionScriptComment">//----------------------------------
</span>    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Storage for the openAlways property.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_openAlways</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
    
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Inspectable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">category</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;General&quot;</span>, <span class="ActionScriptDefault_Text">defaultValue</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;false&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
    
    <span class="ActionScriptASDoc">/**
     *  If &lt;code&gt;true&lt;/code&gt;, specifies to pop up the 
     *  &lt;code&gt;popUp&lt;/code&gt; when you click the main button. 
     *  The &lt;code&gt;popUp&lt;/code&gt; always appears when you press the Spacebar, 
     *  or when you click the pop-up button, regardless of the setting of 
     *  the &lt;code&gt;openAlways&lt;/code&gt; property.
     *
     *  @default false
     */</span>     
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">openAlways</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// We are not exposing this property for now, until the need arises.
</span>        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_openAlways</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>  
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">openAlways</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_openAlways</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  popUp
</span>    <span class="ActionScriptComment">//----------------------------------
</span>    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Storage for popUp property.
     */</span>    
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IUIComponent</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">null</span>;
    
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&apos;popUpChanged&apos;</span><span class="ActionScriptBracket/Brace">)]</span>
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Inspectable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">category</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;General&quot;</span>, <span class="ActionScriptDefault_Text">defaultValue</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;null&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
    
    <span class="ActionScriptASDoc">/**
     *  Specifies the UIComponent object, or object defined by a subclass 
     *  of UIComponent, to pop up. 
     *  For example, you can specify a Menu, TileList, or Tree control. 
     *
     *  @default null 
     */</span>    
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">popUp</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IUIComponent</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_popUp</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>  
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">popUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IUIComponent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
        <span class="ActionScriptDefault_Text">popUpChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;

        <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden methods: UIComponent
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>    
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">commitProperties</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">commitProperties</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">popUpChanged</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">IFocusManagerComponent</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">IFocusManagerComponent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">focusEnabled</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
                
            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">cacheAsBitmap</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">scrollRect</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Rectangle</span><span class="ActionScriptBracket/Brace">(</span>0, 0, 0, 0<span class="ActionScriptBracket/Brace">)</span>;        
            
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">Menu</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MenuEvent</span>.<span class="ActionScriptDefault_Text">MENU_HIDE</span>, <span class="ActionScriptDefault_Text">menuHideHandler</span><span class="ActionScriptBracket/Brace">)</span>;
                
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">IListItemRenderer</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span>
                    <span class="ActionScriptDefault_Text">ListEvent</span>.<span class="ActionScriptDefault_Text">ITEM_CLICK</span>, <span class="ActionScriptDefault_Text">popUpItemClickHandler</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">FlexMouseEvent</span>.<span class="ActionScriptDefault_Text">MOUSE_DOWN_OUTSIDE</span>,
                                    <span class="ActionScriptDefault_Text">popMouseDownOutsideHandler</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">FlexMouseEvent</span>.<span class="ActionScriptDefault_Text">MOUSE_WHEEL_OUTSIDE</span>,
                                    <span class="ActionScriptDefault_Text">popMouseDownOutsideHandler</span><span class="ActionScriptBracket/Brace">)</span>;
                
            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">owner</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">this</span>;
            
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">FlexVersion</span>.<span class="ActionScriptDefault_Text">compatibilityVersion</span> <span class="ActionScriptOperator">&gt;=</span> <span class="ActionScriptDefault_Text">FlexVersion</span>.<span class="ActionScriptDefault_Text">VERSION_3_0</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">ISimpleStyleClient</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">ISimpleStyleClient</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">styleName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;popUpStyleName&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptDefault_Text">popUpChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">measure</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">measure</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptDefault_Text">calcArrowButtonSize</span><span class="ActionScriptBracket/Brace">()</span>;
        
        <span class="ActionScriptComment">// Add in pop-up button width
</span>        <span class="ActionScriptDefault_Text">measuredWidth</span> <span class="ActionScriptOperator">+=</span> <span class="ActionScriptDefault_Text">arrowButtonsWidth</span>;
        <span class="ActionScriptDefault_Text">measuredHeight</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">arrowButtonsHeight</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">styleChanged</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// PopUpIcon style prop has changed, dump skins
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">null</span> <span class="ActionScriptOperator">||</span>
            <span class="ActionScriptDefault_Text">styleProp</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;styleName&quot;</span> <span class="ActionScriptOperator">||</span>
            <span class="ActionScriptDefault_Text">styleProp</span>.<span class="ActionScriptDefault_Text">toLowerCase</span><span class="ActionScriptBracket/Brace">()</span>.<span class="ActionScriptDefault_Text">indexOf</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;popupicon&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptOperator">-</span>1<span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">popUpIconChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
            <span class="ActionScriptDefault_Text">changeSkins</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowButtonWidth&quot;</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">invalidateSize</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;popUpStyleName&quot;</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">_popUp</span> 
                <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">FlexVersion</span>.<span class="ActionScriptDefault_Text">compatibilityVersion</span> <span class="ActionScriptOperator">&gt;=</span> <span class="ActionScriptDefault_Text">FlexVersion</span>.<span class="ActionScriptDefault_Text">VERSION_3_0</span>
                <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">ISimpleStyleClient</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">ISimpleStyleClient</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">styleName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;popUpStyleName&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
            
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">styleChanged</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden methods: Button
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">layoutContents</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">unscaledWidth</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>,
                                                 <span class="ActionScriptDefault_Text">unscaledHeight</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>,
                                                 <span class="ActionScriptDefault_Text">offset</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">((!</span><span class="ActionScriptDefault_Text">isNaN</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">explicitWidth</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">isNaN</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">explicitHeight</span><span class="ActionScriptBracket/Brace">))</span> <span class="ActionScriptOperator">||</span>
            <span class="ActionScriptDefault_Text">popUpIconChanged</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">calcArrowButtonSize</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptDefault_Text">popUpIconChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptDefault_Text">unscaledWidth</span> <span class="ActionScriptOperator">-=</span> <span class="ActionScriptDefault_Text">arrowButtonsWidth</span>;
        
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">layoutContents</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">unscaledWidth</span>, <span class="ActionScriptDefault_Text">unscaledHeight</span>, <span class="ActionScriptDefault_Text">offset</span><span class="ActionScriptBracket/Brace">)</span>;
        
        <span class="ActionScriptDefault_Text">unscaledWidth</span> <span class="ActionScriptOperator">+=</span> <span class="ActionScriptDefault_Text">arrowButtonsWidth</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Displays one of the six possible skins,
     *  creating it if it doesn&apos;t already exist.
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">viewSkin</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Determine which skin to display, based on whether this
</span>        <span class="ActionScriptComment">// PopUpButton is enabled or disabled, whether it is
</span>        <span class="ActionScriptComment">// selected or unselected, and how it is currently interacting
</span>        <span class="ActionScriptComment">// with the mouse (i.e., the up/over/down state).
</span>        
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">tempSkinName</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>;
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">stateName</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>;
        
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">tempSkinName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;disabledSkin&quot;</span>;
            <span class="ActionScriptDefault_Text">stateName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;disabled&quot;</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowOver&quot;</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">tempSkinName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;popUpOverSkin&quot;</span>;
            <span class="ActionScriptDefault_Text">stateName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;popUpOver&quot;</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowDown&quot;</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">tempSkinName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;popUpDownSkin&quot;</span>;   
            <span class="ActionScriptDefault_Text">stateName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;popUpDown&quot;</span>;             
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">tempSkinName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;Skin&quot;</span>;
            <span class="ActionScriptDefault_Text">stateName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">phase</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptDefault_Text">viewSkinForPhase</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">tempSkinName</span>, <span class="ActionScriptDefault_Text">stateName</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getCurrentIconName</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">iconName</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">getCurrentIconName</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">iconName</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">iconName</span>; 

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowOver&quot;</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">iconName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">selected</span> <span class="ActionScriptOperator">?</span> <span class="ActionScriptDefault_Text">selectedOverIconName</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">overIconName</span>;
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowDown&quot;</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">iconName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">selected</span> <span class="ActionScriptOperator">?</span> <span class="ActionScriptDefault_Text">selectedDownIconName</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">downIconName</span>;
        <span class="ActionScriptReserved">else</span>
            <span class="ActionScriptDefault_Text">iconName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;Icon&quot;</span>;

        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">iconName</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Displays one of the four possible icons,
     *  creating it if it doesn&apos;t already exist.
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">viewIcon</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Determine which skin to display, based on whether this
</span>        <span class="ActionScriptComment">// PopUpButton is enabled or disabled, whether it is
</span>        <span class="ActionScriptComment">// selected or unselected, and how it is currently interacting
</span>        <span class="ActionScriptComment">// with the mouse (i.e., the up/over/down state).
</span>        
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">iconName</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>;
        
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">iconName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;disabledIcon&quot;</span>;
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowOver&quot;</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">iconName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">selected</span> <span class="ActionScriptOperator">?</span> <span class="ActionScriptDefault_Text">selectedOverIconName</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">overIconName</span>;
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowDown&quot;</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">iconName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">selected</span> <span class="ActionScriptOperator">?</span> <span class="ActionScriptDefault_Text">selectedDownIconName</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">downIconName</span>;
        <span class="ActionScriptReserved">else</span>
            <span class="ActionScriptDefault_Text">iconName</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;Icon&quot;</span>;
        
        <span class="ActionScriptDefault_Text">viewIconForPhase</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">iconName</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Methods
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Used by PopUpMenuButton
     */</span>     
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getPopUp</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IUIComponent</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptOperator">?</span> <span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptReserved">null</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  Opens the UIComponent object specified by the &lt;code&gt;popUp&lt;/code&gt; property.
     */</span>  
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">open</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">openWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">openWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">trigger</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">showingPopUp</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">displayPopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">true</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">cbde</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">DropdownEvent</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">DropdownEvent</span><span class="ActionScriptBracket/Brace">(D</span><span class="ActionScriptDefault_Text">ropdownEvent</span>.<span class="ActionScriptDefault_Text">OPEN</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">cbde</span>.<span class="ActionScriptDefault_Text">triggerEvent</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">trigger</span>;
            <span class="ActionScriptDefault_Text">dispatchEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">cbde</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  Closes the UIComponent object opened by the PopUpButton control.
     */</span>  
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">close</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">closeWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">closeWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">trigger</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">showingPopUp</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">displayPopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">false</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">cbde</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">DropdownEvent</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">DropdownEvent</span><span class="ActionScriptBracket/Brace">(D</span><span class="ActionScriptDefault_Text">ropdownEvent</span>.<span class="ActionScriptDefault_Text">CLOSE</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">cbde</span>.<span class="ActionScriptDefault_Text">triggerEvent</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">trigger</span>;
            <span class="ActionScriptDefault_Text">dispatchEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">cbde</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">displayPopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">initialized</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">show</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">showingPopUp</span><span class="ActionScriptBracket/Brace">))</span>
            <span class="ActionScriptReserved">return</span>;
        <span class="ActionScriptComment">// Subclasses may extend to do pre-processing
</span>        <span class="ActionScriptComment">// before the popUp is displayed
</span>        <span class="ActionScriptComment">// or override to implement special display behavior
</span>        
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">popUpGap</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;popUpGap&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">point</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Point</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Point</span><span class="ActionScriptBracket/Brace">(</span>0, <span class="ActionScriptDefault_Text">unscaledHeight</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">popUpGap</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptDefault_Text">point</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">localToGlobal</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">point</span><span class="ActionScriptBracket/Brace">)</span>;
        
        <span class="ActionScriptComment">//Show or hide the popup
</span>        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">initY</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>;
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">endY</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>;
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">easingFunction</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Function</span>;
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">duration</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>;
            
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getPopUp</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptReserved">return</span>;

            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">parent</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">PopUpManager</span>.<span class="ActionScriptDefault_Text">addPopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span>, <span class="ActionScriptReserved">this</span>, <span class="ActionScriptReserved">false</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">owner</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">this</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptDefault_Text">PopUpManager</span>.<span class="ActionScriptDefault_Text">bringToFront</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptDefault_Text">point</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">parent</span>.<span class="ActionScriptDefault_Text">globalToLocal</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">point</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">y</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">&gt;</span> <span class="ActionScriptDefault_Text">screen</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">y</span> <span class="ActionScriptOperator">&gt;</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span><span class="ActionScriptBracket/Brace">))</span>
            <span class="ActionScriptBracket/Brace">{</span> 
                <span class="ActionScriptComment">// PopUp will go below the bottom of the stage
</span>                <span class="ActionScriptComment">// and be clipped. Instead, have it grow up.
</span>                <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">y</span> <span class="ActionScriptOperator">-=</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">unscaledHeight</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">+</span> 2<span class="ActionScriptOperator">*</span><span class="ActionScriptDefault_Text">popUpGap</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">initY</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptOperator">-</span><span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">initY</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span>;
            <span class="ActionScriptBracket/Brace">}</span>

            <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">x</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">min</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">x</span>, <span class="ActionScriptDefault_Text">screen</span>.<span class="ActionScriptDefault_Text">width</span> <span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">getExplicitOrMeasuredWidth</span><span class="ActionScriptBracket/Brace">())</span>;
            <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">x</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">max</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">x</span>, 0<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">x</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">x</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">y</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">y</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">move</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">x</span>, <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">y</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">scrollRect</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Rectangle</span><span class="ActionScriptBracket/Brace">(</span>0, <span class="ActionScriptDefault_Text">initY</span>,
                    <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">width</span>, <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">visible</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">visible</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
            
            <span class="ActionScriptDefault_Text">endY</span> <span class="ActionScriptOperator">=</span> 0;
            <span class="ActionScriptDefault_Text">showingPopUp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">show</span>;
            <span class="ActionScriptDefault_Text">duration</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;openDuration&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">easingFunction</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;openEasingFunction&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">Function</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">point</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">parent</span>.<span class="ActionScriptDefault_Text">globalToLocal</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">point</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptDefault_Text">endY</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">y</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">&gt;</span> <span class="ActionScriptDefault_Text">screen</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">&amp;&amp;</span> 
                               <span class="ActionScriptDefault_Text">point</span>.<span class="ActionScriptDefault_Text">y</span> <span class="ActionScriptOperator">&gt;</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span><span class="ActionScriptBracket/Brace">)</span>
                               <span class="ActionScriptOperator">?</span> <span class="ActionScriptOperator">-</span><span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">-</span> 2
                               <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">+</span> 2<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">initY</span> <span class="ActionScriptOperator">=</span> 0;
            <span class="ActionScriptDefault_Text">showingPopUp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">show</span>;
            <span class="ActionScriptDefault_Text">duration</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;closeDuration&quot;</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">easingFunction</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;closeEasingFunction&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">Function</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptDefault_Text">inTween</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptDefault_Text">UIComponentGlobals</span>.<span class="ActionScriptDefault_Text">layoutManager</span>.<span class="ActionScriptDefault_Text">validateNow</span><span class="ActionScriptBracket/Brace">()</span>;
        
        <span class="ActionScriptComment">// Block all layout, responses from web service, and other background
</span>        <span class="ActionScriptComment">// processing until the tween finishes executing.
</span>        <span class="ActionScriptDefault_Text">UIComponent</span>.<span class="ActionScriptDefault_Text">suspendBackgroundProcessing</span><span class="ActionScriptBracket/Brace">()</span>;
        
        <span class="ActionScriptDefault_Text">tween</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Tween</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">this</span>, <span class="ActionScriptDefault_Text">initY</span>, <span class="ActionScriptDefault_Text">endY</span>, <span class="ActionScriptDefault_Text">duration</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">easingFunction</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">tween</span>.<span class="ActionScriptDefault_Text">easingFunction</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">easingFunction</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Calculates the ArrowButton&apos;s sizes.
     */</span> 
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">calcArrowButtonSize</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// If the current skin defines a borderMetrics property,
</span>        <span class="ActionScriptComment">// then use it. Otherwise, use a default value.
</span>        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">bm</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">EdgeMetrics</span>;
        
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">FlexVersion</span>.<span class="ActionScriptDefault_Text">compatibilityVersion</span> <span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">FlexVersion</span>.<span class="ActionScriptDefault_Text">VERSION_3_0</span><span class="ActionScriptBracket/Brace">)</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">try</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">bm</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">currentSkin</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptString">&quot;borderMetrics&quot;</span><span class="ActionScriptBracket/Brace">]</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">catch</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Error</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">bm</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">EdgeMetrics</span><span class="ActionScriptBracket/Brace">(</span>3, 3, 3, 3<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">currentSkin</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">IRectangularBorder</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">bm</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">IRectangularBorder</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">currentSkin</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">borderMetrics</span>;
            <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptDefault_Text">bm</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">EdgeMetrics</span><span class="ActionScriptBracket/Brace">(</span>3, 3, 3, 3<span class="ActionScriptBracket/Brace">)</span>;        
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">popUpIcon</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">IFlexDisplayObject</span> <span class="ActionScriptOperator">=</span>
            <span class="ActionScriptDefault_Text">IFlexDisplayObject</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getChildByName</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;popUpIcon&quot;</span><span class="ActionScriptBracket/Brace">))</span>;
        
        <span class="ActionScriptComment">// If not, create it.
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">popUpIcon</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">popUpIconClass</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Class</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Class</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;popUpIcon&quot;</span><span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptDefault_Text">popUpIcon</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">popUpIconClass</span><span class="ActionScriptBracket/Brace">()</span>;         
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptDefault_Text">arrowButtonsWidth</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">max</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;arrowButtonWidth&quot;</span><span class="ActionScriptBracket/Brace">)</span>,
                                    <span class="ActionScriptDefault_Text">popUpIcon</span>.<span class="ActionScriptDefault_Text">width</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">bm</span>.<span class="ActionScriptDefault_Text">right</span> <span class="ActionScriptOperator">+</span> 1<span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptDefault_Text">arrowButtonsHeight</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">max</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">measuredHeight</span>,
                                     <span class="ActionScriptDefault_Text">popUpIcon</span>.<span class="ActionScriptDefault_Text">height</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">bm</span>.<span class="ActionScriptDefault_Text">top</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">bm</span>.<span class="ActionScriptDefault_Text">bottom</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     *  Returns true if the mouse is over the pop-up button
     */</span>      
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">overArrowButton</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">localX</span> <span class="ActionScriptOperator">&gt;=</span> <span class="ActionScriptDefault_Text">unscaledWidth</span> <span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">arrowButtonsWidth</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onTweenUpdate</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">scrollRect</span> <span class="ActionScriptOperator">=</span>
            <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Rectangle</span><span class="ActionScriptBracket/Brace">(</span>0, <span class="ActionScriptDefault_Text">value</span>, <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">width</span>, <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onTweenEnd</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">scrollRect</span> <span class="ActionScriptOperator">=</span>
            <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Rectangle</span><span class="ActionScriptBracket/Brace">(</span>0, <span class="ActionScriptDefault_Text">value</span>, <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">width</span>, <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">height</span><span class="ActionScriptBracket/Brace">)</span>;

        <span class="ActionScriptDefault_Text">inTween</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
        <span class="ActionScriptDefault_Text">UIComponent</span>.<span class="ActionScriptDefault_Text">resumeBackgroundProcessing</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">showingPopUp</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">visible</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">scrollRect</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">null</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>
        
    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden event handlers: UIComponent
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">keyDownHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">KeyboardEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">keyDownHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
        
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">ctrlKey</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">DOWN</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">openWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">stopPropagation</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">((</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">ctrlKey</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">UP</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">||</span>
                 <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">ESCAPE</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">closeWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">stopPropagation</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">ENTER</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">showingPopUp</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// Redispatch the event to the popup
</span>            <span class="ActionScriptComment">// and let its keyDownHandler() handle it.
</span>            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">dispatchEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">closeWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;                      
            <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">stopPropagation</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>       
        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">showingPopUp</span> <span class="ActionScriptOperator">&amp;&amp;</span>
                 <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">UP</span> <span class="ActionScriptOperator">||</span>
                  <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">DOWN</span> <span class="ActionScriptOperator">||</span>
                  <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">LEFT</span> <span class="ActionScriptOperator">||</span>
                  <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">RIGHT</span> <span class="ActionScriptOperator">||</span>
                  <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">PAGE_UP</span> <span class="ActionScriptOperator">||</span>
                  <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">PAGE_DOWN</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// Redispatch the event to the popup
</span>            <span class="ActionScriptComment">// and let its keyDownHandler() handle it.
</span>            <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">dispatchEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">stopPropagation</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">focusOutHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">FocusEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Note: event.relatedObject is the object getting focus.
</span>        <span class="ActionScriptComment">// It can be null in some cases, such as when you open
</span>        <span class="ActionScriptComment">// the popUp and then click outside the application.
</span>
        <span class="ActionScriptComment">// If the dropdown is open...
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">showingPopUp</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// If focus is moving outside the popUp...
</span>            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(!</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">relatedObject</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">close</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">relatedObject</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">Menu</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">// For nested Menu&apos;s find parent.
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">target</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Menu</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Menu</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">relatedObject</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptReserved">while</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">target</span>.<span class="ActionScriptDefault_Text">parentMenu</span><span class="ActionScriptBracket/Brace">)</span> 
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">target</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">target</span>.<span class="ActionScriptDefault_Text">parentMenu</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">DisplayObjectContainer</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">DisplayObjectContainer</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">contains</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">target</span><span class="ActionScriptBracket/Brace">))</span>
                    <span class="ActionScriptDefault_Text">close</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptReserved">is</span> <span class="ActionScriptDefault_Text">DisplayObjectContainer</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">DisplayObjectContainer</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">contains</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">relatedObject</span><span class="ActionScriptBracket/Brace">))</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">close</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">focusOutHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden event handlers: Button
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">rollOverHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Check if the pop-up button was pressed.
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">overArrowButton</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;arrowOver&quot;</span>;
            <span class="ActionScriptDefault_Text">viewSkin</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptReserved">return</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">rollOverHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">rollOutHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Check if the pop-up button was pressed.
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">overArrowButton</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;up&quot;</span>;
            <span class="ActionScriptDefault_Text">viewSkin</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptReserved">return</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">rollOutHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">mouseDownHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Check if the pop-up button was pressed.
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">overArrowButton</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;arrowDown&quot;</span>;            
            <span class="ActionScriptDefault_Text">viewSkin</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptReserved">return</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">mouseDownHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">mouseUpHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Check if the pop-up button was pressed.
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">overArrowButton</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;arrowOver&quot;</span>;            
            <span class="ActionScriptDefault_Text">viewSkin</span><span class="ActionScriptBracket/Brace">()</span>;            
            <span class="ActionScriptReserved">return</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">mouseUpHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">clickHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">overArrowButton</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">showingPopUp</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">closeWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptDefault_Text">openWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;

            <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">stopImmediatePropagation</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">clickHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">openAlways</span><span class="ActionScriptBracket/Brace">)</span> 
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">showingPopUp</span><span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptDefault_Text">closeWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptReserved">else</span>
                    <span class="ActionScriptDefault_Text">openWithEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;       
            <span class="ActionScriptBracket/Brace">}</span>   
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Event handlers
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">mouseMoveHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Check if the pop-up button was pressed.
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;over&quot;</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;arrowOver&quot;</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">phase</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">overArrowButton</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">?</span> <span class="ActionScriptString">&quot;arrowOver&quot;</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptString">&quot;over&quot;</span>;    
            <span class="ActionScriptDefault_Text">viewSkin</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Close popUp for IListItemRenderer&apos;s like List/Menu.
     */</span>   
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">popUpItemClickHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_closeOnActivity</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">close</span><span class="ActionScriptBracket/Brace">()</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Hide is called intermittently before close gets called.
     *  Call close() in such cases to  reset variables.
     */</span>    
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">menuHideHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MenuEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">//we don&apos;t want to close the popUp if we&apos;re just hiding 
</span>        <span class="ActionScriptComment">//a submenu
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">menu</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptDefault_Text">Menu</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">mx_internal</span><span class="ActionScriptOperator">::</span><span class="ActionScriptDefault_Text">getRootMenu</span><span class="ActionScriptBracket/Brace">())</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">return</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptComment">// Menu is hidden through a call to hide()
</span>        <span class="ActionScriptComment">// Make it visible again so that the menu can
</span>        <span class="ActionScriptComment">// be tweened and closed.
</span>        <span class="ActionScriptDefault_Text">showingPopUp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptDefault_Text">_popUp</span>.<span class="ActionScriptDefault_Text">visible</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptDefault_Text">displayPopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">false</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>    
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">popMouseDownOutsideHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// for automated testing, since we&apos;re generating this event and
</span>        <span class="ActionScriptComment">// can only set localX and localY, transpose those coordinates
</span>        <span class="ActionScriptComment">// and use them for the test point.
</span>        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">p</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Point</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">target</span>.<span class="ActionScriptDefault_Text">localToGlobal</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Point</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">localX</span>, 
                                                           <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">localY</span><span class="ActionScriptBracket/Brace">))</span>;
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">hitTestPoint</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">p</span>.<span class="ActionScriptDefault_Text">x</span>, <span class="ActionScriptDefault_Text">p</span>.<span class="ActionScriptDefault_Text">y</span>, <span class="ActionScriptReserved">true</span><span class="ActionScriptBracket/Brace">))</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// do nothing
</span>        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">close</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>    
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">removedFromStageHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptComment">// Ensure we&apos;ve unregistered ourselves from PopupManager, else
</span>        <span class="ActionScriptComment">// we&apos;ll be leaked.
</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">PopUpManager</span>.<span class="ActionScriptDefault_Text">removePopUp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_popUp</span><span class="ActionScriptBracket/Brace">)</span>;
          <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">showingPopUp</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">_popUp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">null</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>
    
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>    
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getUnscaledWidth</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">unscaledWidth</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>    
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getUnscaledHeight</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">unscaledHeight</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">isShowingPopUp</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">showingPopUp</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptDefault_Text">mx_internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">getArrowButtonsWidth</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Number</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">arrowButtonsWidth</span>;
    <span class="ActionScriptBracket/Brace">}</span>

<span class="ActionScriptBracket/Brace">}</span>

<span class="ActionScriptBracket/Brace">}</span>
</pre></body>
</html>
